EmSAT Achieve Exam  >  EmSAT Achieve Questions  >  #include<iostream>using namespace std;c... Start Learning for Free
#include<iostream>
using namespace std;
class Base
{
public:
    virtual void show() = 0;
};
int main(void)
{
    Base b;
    Base *bp;
    return 0;
}
  • a)
    There are compiler errors in lines "Base b;" and "Base bp;"
  • b)
    There is compiler error in line "Base b;"
  • c)
    There is compiler error in line "Base bp;"
  • d)
    No compiler Error
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
#include<iostream>using namespace std;class Base{public: virtua...
Since Base has a pure virtual function, it becomes an abstract class and an instance of it cannot be created. So there is an error in line "Base b". Note that there is no error in line "Base *bp;". We can have pointers or references of abstract classes.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Question Description
#include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? for EmSAT Achieve 2025 is part of EmSAT Achieve preparation. The Question and answers have been prepared according to the EmSAT Achieve exam syllabus. Information about #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for EmSAT Achieve 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer?.
Solutions for #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for EmSAT Achieve. Download more important topics, notes, lectures and mock test series for EmSAT Achieve Exam by signing up for free.
Here you can find the meaning of #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice #include<iostream>using namespace std;class Base{public: virtual void show() = 0;};int main(void){ Base b; Base *bp; return 0;}a)There are compiler errors in lines "Base b;" and "Base bp;"b)There is compiler error in line "Base b;"c)There is compiler error in line "Base bp;"d)No compiler ErrorCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice EmSAT Achieve tests.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev